<!--
 * @Descripttion: 
 * @version: 
 * @Author: congsir
 * @Date: 2023-10-28 14:12:51
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-10-28 21:35:35
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./css/reset.css" />
    <link rel="stylesheet" href="./css/common.css" />
    <style>
      .top {
        height: 70px;
        box-sizing: border-box;
        background-color: #242424;
        border-bottom: 1px solid #000;
      }
      .topbar {
        display: flex;
        justify-content: space-between;
        height: 69px;
        line-height: 69px;
        /* align-items: center; */
        /* 不使用center的原因：这里的设置height后item高度会拉伸填充，同时line-height会被item继承 */
      }
      .topbar .top_left {
        display: flex;
      }
      /* logo的固定写法适应SEO中h1 */
      .topbar .top_left .logo {
        background-image: url(./images/topbar_sprite.png);
      }
      .topbar .top_left .logo a {
        display: inline-block;
        /* 1.这里a是行内非替换元素不可以直接设置text-indent：联想p中添加text-indent */
        /* 2.这里设置a为 display: inline-block;  可以继承父元素传下来的高度，会撑起a元素，
        如果a元素是行内非替换元素的话不会撑起高度 */

        text-indent: -9999px;
        width: 157px;
        padding-right: 20px;
      }
      .topbar .top_left .list {
        display: flex;
      }
      .topbar .top_left .list .item {
        position: relative;
        display: inline-block;
        font-size: 14px;
        padding: 0 20px;
        color: #ccc;
        /* 这里的a默认是行内非替换元素没能继承父元素的行高 */
      }
      .topbar .top_left .list .item:hover,
      .topbar .top_left .list .item.active {
        color: #fff;
        background-color: #000;
      }
      .topbar .top_left .list .item.active::after {
        content: "";
        width: 12px;
        height: 7px;
        position: absolute;
        bottom: -3px;
        left: 0;
        right: 0;
        margin: 0 auto;
        background: url(./images/topbar_sprite.png) -226px 0;
      }
      /* 第一种写法 */
      /* .topbar .top_left .item .iocn-hot {
        position: absolute;
        width: 28px;
        height: 19px;
        top: 14px;
        right: -18px;
        background: url(./images/topbar_sprite.png) -190px 0;
      } */
      /* 第二种写法：全局 */
      .topbar .top_left .item .iocn-hot {
        top: 14px;
        right: -18px;
        background-position: -190px 0;
      }

      /* 右侧布局 */
      .topbar .top_right {
        display: flex;
        padding-right: 20px;
        align-items: center;
      }
      .topbar .top_right .search {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        box-sizing: border-box;
        padding-right: 10px;
        width: 158px;
        height: 32px;
        border-radius: 30px;
        background: #fff url(./images/topbar_sprite.png) 0 -99px;
      }
      .topbar .top_right .search input {
        width: 120px;
        font-size: 12px;
      }
      .topbar .top_right .search input::-webkit-input-placeholder {
        color: #ccc;
      }
      .topbar .top_right .login a {
        color: #788778;
      }
      .topbar .top_right .login:hover a {
        color: #ccc;
      }
      .topbar .top_right .login a:hover {
        color: #788778;
        text-decoration: underline;
      }
      .topbar .top_right .anthor a {
        display: inline-block;
        width: 90px;
        height: 32px;
        line-height: 32px;
        margin: 0 20px;
        text-align: center;
        color: #ccc;
        box-sizing: border-box;
        border: 1px solid #4f4f4f;
        border-radius: 20px;
      }
      .topbar .top_right .anthor a:hover {
        color: #fff;
        border-color: #fff;
      }
      .nav {
        height: 35px;
        line-height: 35px;
        background-color: #c20c0c;
        box-sizing: border-box;
        border-bottom: 1px solid #a40011;
      }
      .navbar {
        box-sizing: border-box;
        padding-left: 180px;
      }
      .navbar .list {
        display: flex;
      }
      .navbar .list .item {
        display: inline-block;
      }
      .navbar .list .item span {
        display: inline-block;
        padding: 0 13px;
        margin: 7px 17px;
        height: 20px;
        line-height: 20px;
        color: #fff;
        border-radius: 20px;
      }
      .navbar .list .item:hover span,
      .navbar .list .item.active span {
        background-color: #9b0909;
      }
    </style>
  </head>
  <body>
    <div class="top">
      <div class="topbar wrapper_01">
        <div class="top_left">
          <h1 class="logo">
            <a href="#">网易云音乐</a>
          </h1>
          <!-- ul>(li>a[href="#"].item)*6 -->
          <ul class="list">
            <li><a href="#" class="item active">发现音乐</a></li>
            <li><a href="#" class="item">我的音乐</a></li>
            <li><a href="#" class="item">关注</a></li>
            <li><a href="#" class="item">商城</a></li>
            <li><a href="#" class="item">音乐人</a></li>
            <li>
              <a href="#" class="item"
                >下载客户端
                <i class="topbar_sprite topbar_icon_hot iocn-hot"></i>
              </a>
            </li>
          </ul>
        </div>
        <div class="top_right">
          <div class="search">
            <input type="text" placeholder="音乐/视频/电台/用户" />
          </div>
          <div class="anthor">
            <a href="#">创作者中心</a>
          </div>
          <div class="login">
            <a href="#">登录</a>
          </div>
        </div>
      </div>
      <div class="topnav"></div>
    </div>
    <div class="nav">
      <!-- 如果block元素没有内容，那么line-height继承过来也不会生效 -->
      <div class="navbar wrapper_01">
        <ul class="list">
          <li>
            <a href="#" class="item active"><span>推荐</span></a>
          </li>
          <li>
            <a href="#" class="item"><span>排行榜</span></a>
          </li>
          <li>
            <a href="#" class="item"><span>歌单</span></a>
          </li>
          <li>
            <a href="#" class="item"><span>主播电台</span></a>
          </li>
          <li>
            <a href="#" class="item"><span>歌手</span></a>
          </li>
          <li>
            <a href="#" class="item"><span>新碟上架</span></a>
          </li>
        </ul>
      </div>
    </div>
  </body>
</html>
